/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UsoMetodosYVariables;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Dennis
 */
public class ListarRango {
   
    int [] crearRango(int inferior, int superior){
        
        int[] rango = new int [(superior-inferior)+1];
        for (int i = 0; i < rango.length ; i++) {
            rango[i] = inferior++;
        }
        return rango;
    }
        
    public static void main(String[] args) throws IOException{
        int[] rango;
        ListarRango listar = new ListarRango();
        
        BufferedReader buf1 = new BufferedReader(new InputStreamReader(System.in));               
         
        System.out.print("Ingrese la cota Inferior: ");
        String inf = buf1.readLine();
        
        System.out.print("Ingrese la cota Superior: ");
        String sup = buf1.readLine();                                
        
        //casting
        int infConv = Integer.parseInt(inf);
        int supConv = Integer.parseInt(sup);                         
                
        rango = listar.crearRango(infConv, supConv);
        
        System.out.print("El array: [ ");
        
        for (int i = 0; i < rango.length; i++) {
            System.out.print(rango[i]+" ");
        }
        
        System.out.println(" ]");
    }
}
